package cn.com.huzo.model.entities.manufacture;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 加工承揽合同主记录实体类
 * <p>
 * @author 吴旭
 */
public class CommissionProcessingContractHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 6788913693419416581L;
    private Long HeaderId;
    private String ContractNo;            // 加工合同号
    private Timestamp DateOfSigned;       // 签订日期
    private Long SecondPartyId;           // 承揽方（乙方）
    private String SecondPartyName;
    private Long SignedBy;                // 业务代表（签订人）
    private String SignedByName;
    private Double TaxRate;               // 含税状况
    private Long CurrencyId;              // 币种
    private String CurrencyName;
    private String InvoiceTitle;          // 加工费发票抬头
    private Double Amount;                // 总金额
    private String AdvancePaymentFlag;    // 预付款标记
    private String OverFlag;              // 完成标记
    private String Description;

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getContractNo() {
        return ContractNo;
    }

    public void setContractNo(String ContractNo) {
        this.ContractNo = ContractNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfSigned() {
        return DateOfSigned;
    }

    public void setDateOfSigned(Timestamp DateOfSigned) {
        this.DateOfSigned = DateOfSigned;
    }

    public Long getSecondPartyId() {
        return SecondPartyId;
    }

    public void setSecondPartyId(Long SecondPartyId) {
        this.SecondPartyId = SecondPartyId;
    }

    public String getSecondPartyName() {
        return SecondPartyName;
    }

    public void setSecondPartyName(String SecondPartyName) {
        this.SecondPartyName = SecondPartyName;
    }

    public Long getSignedBy() {
        return SignedBy;
    }

    public void setSignedBy(Long SignedBy) {
        this.SignedBy = SignedBy;
    }

    public String getSignedByName() {
        return SignedByName;
    }

    public void setSignedByName(String SignedByName) {
        this.SignedByName = SignedByName;
    }

    public Double getTaxRate() {
        return TaxRate;
    }

    public void setTaxRate(Double TaxRate) {
        this.TaxRate = TaxRate;
    }

    public Long getCurrencyId() {
        return CurrencyId;
    }

    public void setCurrencyId(Long CurrencyId) {
        this.CurrencyId = CurrencyId;
    }

    public String getCurrencyName() {
        return CurrencyName;
    }

    public void setCurrencyName(String CurrencyName) {
        this.CurrencyName = CurrencyName;
    }

    public String getInvoiceTitle() {
        return InvoiceTitle;
    }

    public void setInvoiceTitle(String InvoiceTitle) {
        this.InvoiceTitle = InvoiceTitle;
    }

    public Double getAmount() {
        return Amount;
    }

    public void setAmount(Double Amount) {
        this.Amount = Amount;
    }

    public String getAdvancePaymentFlag() {
        return AdvancePaymentFlag;
    }

    public void setAdvancePaymentFlag(String AdvancePaymentFlag) {
        this.AdvancePaymentFlag = AdvancePaymentFlag;
    }

    public String getOverFlag() {
        return OverFlag;
    }

    public void setOverFlag(String OverFlag) {
        this.OverFlag = OverFlag;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CommissionProcessingContractHeaderEntity)) {
            return false;
        }

        final CommissionProcessingContractHeaderEntity that = (CommissionProcessingContractHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
